{extend name="index/index"}


{block name="sidebar"}
<div id="sidebar-menu">
	<ul>
		<li class='has_sub'><a href='javascript:void(0);'><i class='icon-home-3'></i><span>仪表盘</span>
			<span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
			<ul>
				<li><a href='{:url("admin/Index/login")}' ><span>首页</span></a></li>
			</ul>
		</li>
		<li class='has_sub'><a href='javascript:void(0);'><i
				class='icon-feather'></i><span>用户管理</span> <span class="pull-right"><i
				class="fa fa-angle-down"></i></span></a>
			<ul>
				<li><a href='{:url("admin/User/index")}'><span>用户列表</span></a></li>
				<li><a href='{:url("admin/User/create")}'><span>用户添加</span></a></li>
			</ul>
		</li>
		<li class='has_sub'><a href='javascript:void(0);'><i class='fa fa-map-marker'></i><span>管理员管理</span>
			<span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
			<ul>
				<li><a href='{:url("admin/Admin/index")}'><span>管理员列表</span></a></li>
				<li><a href='{:url("admin/Admin/create")}'><span>管理员添加</span></a></li>
			</ul>
		</li>
		<li class='has_sub'><a href='javascript:void(0);'><i class='icon-pencil-3'></i><span>角色管理</span>
			<span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
			<ul>
				<li><a href='{:url("admin/role/index")}' class='active'><span>角色列表</span></a></li>
			</ul>
		</li>
		<li class='has_sub'><a href='javascript:void(0);'><i class='fa fa-table'></i><span>权限管理</span>
			<span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
			<ul>
				<li><a href='{:url("admin/auth/index")}'><span>权限列表</span></a></li>
				<li><a href='{:url("admin/auth/create")}'><span>权限添加</span></a></li>
			</ul>
		</li>
		<li class='has_sub'><a href='javascript:void(0);'><i class='fa fa-envelope'></i><span>笔记管理</span>
			<span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
			<ul>
				<li><a href='{:url("admin/Note/index")}'><span>笔记列表</span></a></li>
			</ul>
		</li>
		<li class='has_sub'><a href='javascript:void(0);'><i class='icon-chart-line'></i><span>分类管理</span>
			<span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
			<ul>
				<li><a href='{:url("admin/Category/index")}'><span>分类列表</span></a></li>
				<li><a href='{:url("admin/Category/add")}'><span>分类添加</span></a></li>
				<li><a href='{:url("admin/Category/noteList")}'><span>笔记类型列表</span></a></li>
				<li><a href='{:url("admin/Category/noteAdd")}'><span>笔记类型添加</span></a></li>
			</ul>
		</li>
		<li class='has_sub'><a href='javascript:void(0);'><i class='icon-megaphone'></i><span>评论管理</span>
			<span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
			<ul>
				<li><a href='{:url("admin/Comment/index")}'><span>评论列表</span></a></li>
			</ul>
		</li>
		<li class='has_sub'><a href='javascript:void(0);'><i class='icon-megaphone'></i><span>新闻管理</span>
			<span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
			<ul>
				<li><a href='{:url("admin/news/index")}'><span>新闻列表</span></a></li>
				<li><a href='{:url("admin/news/create")}'><span>添加新闻</span></a></li>
			</ul>
		</li>
		<li class='has_sub'><a href='javascript:void(0);'><i class='icon-megaphone'></i><span>推荐管理</span>
			<span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
			<ul>
				<li><a href='{:url("admin/Top/index")}'><span>推荐列表</span></a></li>
			</ul>
		</li>
	</ul>
	<div class="clearfix"></div>
</div>
{/block}


{block name="main"}
<div class="md-modal md-fade-in-scale-up" id="md-fade-in-scale-up">
	<div class="md-content">
		<h3>添加角色</h3>
		<div class="widget-content padding">
			<label>角色名</label>
			<input type="text" class="form-control" id="name" name="name">
			<p>
				<button class="btn btn-danger md-close">取消</button>
				<button class="btn btn-success md-close sub-btn">确定</button>
			</p>
		</div>
	</div>
</div>
<div class="row">
	<div class="col-md-12">
		<div class="widget">
			<div class="widget-header transparent">
				<h2><strong>角色列表</strong> RoleTable</h2>
				<div class="additional-btn">
					<div class="col-md-4 col-md-offset-8">
						<div class="input-group">
							<input type="text"  class="form-control" placeholder="请输入要搜索的角色" data-toggle="hideseek" data-list=".default_list_data" data-nodata="找不到该相关" autocomplete="off">
							<span class="input-group-btn">
                            <button class="btn btn-info" type="button"><span class="glyphicon glyphicon-search"></span></button>
                        </span>
						</div>
					</div>
				</div>
			</div>
			<div class="widget-content">
				<div class="data-table-toolbar">
					<div class="row">
						<div class="col-md-8 col-md-offset-4">
							<div class="toolbar-btn-action">
								<a href="javascript:void(0)" class="btn btn-success md-trigger"
								   data-modal="md-fade-in-scale-up">
									<i class="fa fa-plus-circle"></i> 添加角色
								</a>
							</div>
						</div>
					</div>
				</div>
				<div class="table-responsive">
					<table data-sortable class="table table-hover table-striped">
						<thead>
						<tr>
							<th>ID</th>
							<th>角色名</th>
							<th>拥有权限</th>
							<th>Status</th>
							<th data-sortable="false">Option</th>
						</tr>
						</thead>
						<tbody class="default_list_data">
						{volist name="list" id="val"}
						<tr class="roleid{$val['id']}">
							<td>{$val['id']}</td>
							<td><strong>{$val['role_name']}</strong></td>
							<td class="col-md-6">
								{volist name="$val['roles']" id="v"}
								<span class="col-md-2" style="padding: 0">{$v['auth_name']}</span>
								{/volist}
							</td>
							<td>
								<span class="label {$val['status'] == 1?'label-success':'label-danger'}">
									{$val['status'] == 1?'Action':'Ban'}
								</span>
							</td>
							<td>
								<div class="btn-group btn-group-xs">
									<a href="javascript:void(0);" data-id="{$val['id']}" title="{$val['status'] == 1?'禁用':'启用'}" class="btn {$val['status'] == 1?'btn-danger':'btn-success'} status-btn">
										<i class="fa fa-power-off"></i>
									</a>
									<a href="{:url('admin/role/edit',['id' => $val['id']])}" title="更改" class="btn btn-info">
										<i class="glyphicon glyphicon-edit"></i>
									</a>
								</div>
							</td>
						</tr>
						{/volist}
						</tbody>
					</table>
					<div class="pull-right" style="margin-right: 10px">{$list->render()}</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="md-overlay"></div>
<script src="__ADJS__role.js"></script>
{/block}